//
//  CALayer+TYZAdd.h
//  DrivieSchoolStudents
//
//  Created by TangBin on 2019/5/15.
//  Copyright © 2019 班文政. All rights reserved.
//

#import <QuartzCore/QuartzCore.h>

NS_ASSUME_NONNULL_BEGIN

@interface CALayer (TYZAdd)

/**
 *  画线条
 *
 *  @param view      父视图
 *  @param frame     frame
 *  @param lineColor line color
 *
 *  @return CALayer
 */
+ (CALayer *)drawLine:(UIView *)view frame:(CGRect)frame lineColor:(UIColor *)lineColor;

/**
 *  绘制虚线到view
 *
 *  @param view        父视图
 *  @param frame       frame
 *  @param lineSpacing 虚线之间的间隔
 *  @param lineColor   颜色
 *
 *  @return 返回一条虚线
 */
+ (CAShapeLayer *)drawDashLine:(UIView *)view frame:(CGRect)frame lineSpacing:(CGFloat)lineSpacing lineColor:(UIColor *)lineColor lineWidth:(CGFloat)lineWidth;

/// 画视图的虚线
/// @param view 视图
/// @param frame 视图
/// @param lineSpacing lineSpacing description
/// @param lineColor lineColor description
/// @param lineWidth lineWidth description
+ (void)addBorderLayer:(UIView *)view frame:(CGRect)frame lineSpacing:(CGFloat)lineSpacing lineColor:(UIColor *)lineColor lineWidth:(CGFloat)lineWidth;

/**
 *  视图部分边缘圆角(在矩形中，可以针对四角中的某个角加圆角, 一般用于设置某个视图的顶端两角为圆形)
 eg:
 UIView *view = [UIView new];
 CAShapeLayer *shapeLayer = [CALayer bezierPathRound:];
 view.layer.mask = shapeLayer;
 *
 *  @param bounds 视图的bounds
 *  @param cornerRadii 圆角的大小
 *  @param roundingCorners 枚举值，可以选择某个角
 */
+ (CAShapeLayer *)bezierPathRound:(CGRect)bounds cornerRadii:(CGSize)cornerRadii roundingCorners:(UIRectCorner)roundingCorners;


@end

NS_ASSUME_NONNULL_END
